{% load portal.templatetags.filters %}
{% extends "base.html" %}
{% block content %}
            {% if list %}
                <h2>Arhiv novic</h2>
                <br />
                <ul class="archive">
                {% for month in months %}
                    <li><a href="/portal/archive/{{ month.0 }}/{{ month.2 }}/">{{ month.1 }} {{ month.2 }}</b></li>
                {% endfor %}
                </ul>
            {% else %}
            <h2 class="forum-link"><a href="/portal/archive/">nazaj</a></h2>
            <h2>Arhiv novic za mesec {{ month }}, {{ year }}</h2>
            <br />
			<ul class="news">
			    {% for day in content %}
			    <li>
					<span class="date">{{day.date|beautify_date}}</span>
					{% for news in day.news %}
					<p class="content">
						{{news.content}}
					</p>
					{% endfor %}
					{% if day.packages %}
					<div>
						<h2>Nove knjižnice</h2>
						<ul class="ullist">
						    {% for package in day.packages %}
						    <li><a href="{{package.url}}">{{ package.title }}</a> - {{package.content|truncatewords_html:"20"}}</li>
						    {% endfor %}	
						</ul>
					</div>
					<br />
					{% endif %}
					{% if day.posts %}
					<div>
						<h2>Novo na blogih</h2>
						<ul class="ullist">
						    {% for post in day.posts %}
						    <li><a href="{{post.url}}">{{ post.title }}</a> - {{post.content|truncatewords_html:"40"}}</li>
						    {% endfor %}	
						</ul>
					</div>
					<br />
					{% endif %}
				</li>
				{% endfor %}
			</ul>
			{% endif %}
{% endblock %}